<?php $__env->startSection('web_title','医生管理'); ?>

<?php $__env->startSection('css'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('css/reservation.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('css/main.css')); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <!--内容区域-->
    <div class="row">
        <div class="col-xs-12 content-box">
            <!--填充内容区域-->
        <?php if($user->isDoctor()): ?>
            <!-- 医生 用户 -->
                <div class="doctorContent" id="doctorContent">
                    <div class="row">
                        <div class="col-xs-12 padding-lr-0">
                            <div class="ibox float-e-margins addDoctor">
                                <div class="ibox-title adminTitle">
                                    <h5>出诊时间和人数设置</h5>
                                </div>
                                <div class="ibox-content">
                                    <div class="row margin-bottom-15">
                                        <div class="col-xs-12">
                                            <button type="button" class="btn btn-primary btn-outline margin-right-5 but_Fonts"
                                                    id="getPrevMonthBtn">获取上月出诊并保存为当月
                                            </button>
                                            <button type="button" class="btn btn-primary btn-outline margin-right-5 but_Fonts"
                                                    id="clearPlanOfMonthBtn">清空当月设置
                                            </button>
                                        </div>
                                    </div>
                                    <div class='calendar but_Fonts' id='calendar'></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 设置出诊日期和数量 Modal -->
                <div class="modal fade" id="setVisited" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                     aria-hidden="true" data-backdrop="static" data-keyboard=false>
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                            aria-hidden="true">&times;</span></button>
                                <h3 class="modal-title">设置出诊日期和数量</h3>
                            </div>
                            <div class="modal-body">
                                <div class="row doctorContent">
                                    <!--上午-->
                                    <div class="col-xs-6">
                                        <div class="row">
                                            <div class="col-xs-6">
                                                <span class="selectTime" data-id="morningPeriodTime">上午</span>
                                            </div>
                                            <div class="col-xs-6 text-right display-none">
                                                <span class="glyphicon glyphicon-plus addSelectTime"
                                                      data-id="morningPeriodTime">追加上午时段</span>
                                            </div>
                                        </div>
                                        <div class="row periodTime" id="morningPeriodTime"></div>
                                    </div>
                                    <!--下午-->
                                    <div class="col-xs-6">
                                        <div class="row">
                                            <div class="col-xs-6">
                                                <span class="selectTime" data-id="afternoonPeriodTime">下午</span>
                                            </div>
                                            <div class="col-xs-6 text-right display-none">
                                                <span class="glyphicon glyphicon-plus addSelectTime"
                                                      data-id="afternoonPeriodTime">追加下午时段</span>
                                            </div>
                                        </div>
                                        <div class="row periodTime" id="afternoonPeriodTime"></div>
                                    </div>
                                </div>
                                <div class="modal-textarea-box margin-top-15 display-none" id="selectClinic">
                                    <span>选择诊室</span>
                                    <select class="form-control m-b margin-bottom-0" name="clinic">
                                        <?php for($i=1; $i<=$hospitals->clinic; $i++): ?>
                                            <option value="<?php echo e($i); ?>">诊室 <?php echo e($i); ?></option>
                                        <?php endfor; ?>
                                    </select>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                <button type="button" class="btn btn-primary" id="setVisitedSaveBtn">保存</button>
                            </div>
                        </div>
                    </div>
                </div>
        <?php else: ?>
            <!-- 管理员 用户 -->
                <div class="adminContent">
                    <!-- 列表页面 -->
                    <div class="doctorList" id="doctorList">
                        <!--搜索栏-->
                        <div class="row">
                            <div class="col-xs-12 background-white">
                                <div class="row searchBox">
                                    <div class="col-xs-2 width-020">
                                        <span>姓名</span>
                                        <input maxlength="16" type="text" class="form-control but_Fonts" placeholder="请输入姓名"
                                               name="name">
                                    </div>
                                    <div class="col-xs-2 width-020">
                                        <span>手机号</span>
                                        <input maxlength="11" type="number" class="form-control phoneLength but_Fonts"
                                               placeholder="请输入手机号" name="phone">
                                    </div>
                                    <div class="col-xs-2 width-020" style="width: 28%;">
                                        <span>医院</span>
                                        <select class="form-control m-b margin-bottom-0 but_Fonts" name="hospital_id">
                                            <?php if($hospitals instanceof \Illuminate\Database\Eloquent\Collection): ?>
                                                <?php $__currentLoopData = $hospitals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $hospital): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($hospital->id); ?>"><?php echo e($hospital->name); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            <?php else: ?>
                                                <option value="<?php echo e($hospitals->id); ?>"><?php echo e($hospitals->name); ?></option>
                                            <?php endif; ?>
                                        </select>
                                    </div>
                                    <div class="col-xs-1 text-center width-006">
                                        <button type="button" class="btn btn-primary but_Fonts" id="doctorManagementSearchBtn">
                                            查询
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- 按钮操作栏 -->
                        <div class="row padding-tb-20 operationBtnBox">
                            <div class="col-xs-12">
                                <button type="button" class="btn btn-primary but_Fonts" id="addDoctorBtn">添加医生</button>
                                <button type="button" class="btn btn-primary but_Fonts" id="deleteDoctorBtn">删除医生</button>
                            </div>
                        </div>
                        <!--患者列表-->
                        <div class="row">
                            <div class="col-xs-12 reservationListBox" id="doctorListBox">
                                <table class="table-bordered table-hover text-center reservationCenter-table doctorManagement-table">
                                    <thead>
                                    <tr>
                                        <th>
                                            <lable><input type="checkbox" class="checkBox"
                                                          data-id="doctorManagementListBody"></lable>
                                        </th>
                                        <th>姓名</th>
                                        <th>职称</th>
                                        <th>角色</th>
                                        <th>手机号</th>
                                        
                                        
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="doctorManagementListBody"></tbody>
                                </table>
                            </div>
                        </div>
                        <div class="row margin-top-15">
                            <div class="col-xs-12 pagerBox text-right">
                                <nav>
                                    <ul class="pagination pagination-lg" id="managementPager"></ul>
                                </nav>
                            </div>
                        </div>
                    </div>
                    <!-- 添加编辑页面 -->
                    <div class="addDoctor display-none" id="addDoctor">
                        <div class="row">
                            <div class="col-xs-12 padding-lr-0">
                                <div class="ibox float-e-margins">
                                    <div class="ibox-title adminTitle">
                                        <h5>医生添加</h5>
                                    </div>
                                    <div class="ibox-content">
                                        <div class="row searchBox">
                                            <form class="form-horizontal">
                                                <input type="hidden" class="form-control emptyInput but_Fonts" name="id">

                                                <div class="form-group">
                                                    <label for="name" class="col-xs-2 control-label">姓名</label>
                                                    <div class="col-xs-6">
                                                        <input type="text" class="form-control emptyInput but_Fonts" id="name"
                                                               placeholder="请输入姓名" maxlength="16" name="name"
                                                               data-check="checkName">
                                                    </div>
                                                </div>

                                                <div class="form-group">
                                                    <label for="phone" class="col-xs-2 control-label">手机号</label>
                                                    <div class="col-xs-6">
                                                        <input type="text" class="form-control emptyInput but_Fonts" id="phone"
                                                               placeholder="请输入手机号" maxlength="11" name="phone"
                                                               data-check="checkPhone">
                                                    </div>
                                                </div>

                                                <div class="form-group">
                                                    <label for="password" class="col-xs-2 control-label">密码</label>
                                                    <div class="col-xs-6">
                                                        <input maxlength="16" type="text" class="form-control emptyInput but_Fonts"
                                                               id="password" placeholder="请输入密码" name="password"
                                                               data-check="checkPassword">
                                                    </div>
                                                </div>

                                                <div class="form-group">
                                                    <label for="role" class="col-xs-2 control-label">角色</label>
                                                    <div class="col-xs-6">
                                                        <select class="form-control but_Fonts" id="role" name="role">
                                                            <option value="doctor">医生</option>
                                                            <option value="nurse">护士</option>
                                                        </select>
                                                    </div>
                                                </div>

                                                <?php if($user->isAdmin()): ?>
                                                    <div class="form-group">
                                                        <label for="hospital" class="col-xs-2 control-label">医院</label>
                                                        <div class="col-xs-6">
                                                            <select class="form-control but_Fonts" id="hospital" name="hospital_id">
                                                                <?php $__currentLoopData = $hospitals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $hospital): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                    <option value="<?php echo e($hospital->id); ?>"><?php echo e($hospital->name); ?></option>
                                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <?php else: ?>
                                                    <input type="hidden" name="hospital_id" value="<?php echo e($user->hospital_id); ?>">
                                                <?php endif; ?>


                                                <div class="form-group">
                                                    <label for="title" class="col-xs-2 control-label">职称</label>
                                                    <div class="col-xs-6">
                                                        <select class="form-control but_Fonts" id="title" name="job">
                                                            <?php $__currentLoopData = app('field')->get('doctor.title'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $title): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                <option value="<?php echo e($key); ?>"><?php echo e($title); ?></option>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                <option value="">请选择</option>
                                                        </select>
                                                    </div>
                                                </div>

                                                <div class="form-group">
                                                    <div class="col-sm-offset-2 col-sm-10">
                                                        <button type="button"
                                                                class="btn btn-primary btn-outline margin-right-80 but_Fonts"
                                                                id="addDoctorBackBtn">返回
                                                        </button>
                                                        <button type="button" class="btn btn-primary but_Fonts"
                                                                id="addDoctorSaveBtn">保存
                                                        </button>
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php endif; ?>


                </div>
        </div>
    <?php $__env->stopSection(); ?>

    <?php $__env->startSection('js'); ?>
        <?php if($user->isDoctor()): ?>
            <!--自定义日历插件 1-->
            <script src="<?php echo e(asset('js/customDatapicker.js')); ?>"></script>
            <!--医生管理 单独文件  1-->
            <script src="<?php echo e(asset('js/doctorManagement.js')); ?>"></script>
        <?php endif; ?>

        <?php if($user->isA('nurse')): ?>
            <!--护士管理 单独文件  1-->
            <script src="<?php echo e(asset('js/nurseManagement.js')); ?>"></script>
        <?php endif; ?>

            <script>
                $('#side-menu li.doctorManagement').addClass('active');//更改导航列表选中样式   不可删除
            </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>